<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://doc.hyperf.io
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
 */

return [
    'app' => [
        // 数组内配置您的全局中间件，顺序根据该数组的顺序
        // 执行顺序为：全局中间件 -> 类级别中间件 -> 方法级别中间件
        Kun\Support\Middleware\CorsMiddleware::class, //跨域
        Kun\Support\Middleware\ContextMiddleware::class,//设置自定义DI和事件上下文
        Kun\Support\Middleware\AuthSessionMiddleware::class, //会话
//        Kun\Support\Middleware\UserAuthMiddleware::class, //鉴权
        App\Acl\Service\Auth\RoleAclMiddleware::class,
        App\Acl\Service\Auth\AclMiddleware::class,//鉴权
    ],
    'admin' => [
        // 数组内配置您的全局中间件，顺序根据该数组的顺序
        // 执行顺序为：全局中间件 -> 类级别中间件 -> 方法级别中间件
        Kun\Support\Middleware\CorsMiddleware::class, //跨域
        //Kun\Support\Middleware\AuthSessionMiddleware::class, //会话
        Kun\Support\Middleware\ContextMiddleware::class,//设置自定义DI和事件上下文
        Kun\Support\Middleware\SessionMiddleware::class, //会话
        App\Admin\Service\Admin\Auth\AuthMiddleware::class,//鉴权
    ],
    'api' => [
        // 数组内配置您的全局中间件，顺序根据该数组的顺序
        // 执行顺序为：全局中间件 -> 类级别中间件 -> 方法级别中间件
        Kun\Support\Middleware\CorsMiddleware::class, //跨域
        Kun\Support\Middleware\ContextMiddleware::class,//设置自定义DI和事件上下文
        App\OauthServer\Service\Api\Auth\ApiAuthMiddleware::class, //鉴权
    ],
];
